/* implements function to output strings to the tty with polling */
#include "kprint.h"

void kprint_char(char c) {
  // Poll until ready to transmit.
  while ( !tty0->lsr.field.thre);	

  // Write character to Transmitter Holding Register
  tty0->thr = c;		    
	  
}

void kprint_string(const char* text) {
  while (text[0] != '\0') {
    if(text[0] == '\n')
      kprint_char('\r');
    kprint_char(text[0]);
    ++text;
  }
  //kprint_char('\n');
  //kprint_char('\r');
}

